package com.ziyun.pop.modules.storeMaterials.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ziyun.pop.modules.storeMaterials.entity.StoreStockMaterialEntity;
import io.renren.common.utils.R;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 门店库存明细表
 *
 * @author guizhao
 * @email 296588519@qq.com
 * @date 2018-10-08 11:31:20
 */
public interface StoreStockMaterialService extends IService<StoreStockMaterialEntity> {

    /**
     * 获取 门店物料库存信息
     * @param materialId
     * @param sellerId
     * @return
     */
    StoreStockMaterialEntity getStockMaterial(String materialId, Long sellerId);

    /**
     * 修改库存
     * @param quantity
     * @param money
     * @param materialId
     */
    Integer updateMaterialInfo(BigDecimal quantity,BigDecimal money ,String materialId,Integer stockID);

    // 库存修改
    Integer updateMaterialWarehouse(BigDecimal StockQuantity,BigDecimal quantity, String materialId, Integer stockId, Integer direction, Date updateTime,BigDecimal price);

    Integer updateMaterialWarehouse2(BigDecimal quantity,Date date,BigDecimal moneys,String materialId,Integer stockId);

    // 查询库存总金额
    BigDecimal getMaterialQuantity(String materialId,Integer stockId);


    //  入库库存修改(materialId,materialQuantity,quantity,price);
    Integer updateQuantityByMaterialId(String materialId,BigDecimal quantity,BigDecimal price,Integer stockId);

     R selectCostByMaterialId(String materialId);

    BigDecimal getMaterialQuantityByStockID(String materialId,Integer stockId);

    BigDecimal getCost(String materialId,Integer stockId);

    Integer updateTIStoreStock(BigDecimal materialQuantity, Integer stockId, String materialId);

}

